package hunt.treasure.scenes;

import hunt.treasure.GameActivity;
import hunt.treasure.manager.ResourceManager;

import org.andengine.engine.Engine;
import org.andengine.engine.camera.Camera;
import org.andengine.entity.scene.Scene;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.util.debug.Debug;
/**
 * Base for all scenes
 * @author vanhu_000
 *
 */
public abstract class AbstractScene extends Scene {

    protected ResourceManager res = ResourceManager.getInstance();

    protected Engine engine;
    protected GameActivity activity;
    protected VertexBufferObjectManager vbom;
    protected Camera camera;
    
    public AbstractScene(){
    	super();
    	this.activity = res.activity;
    	this.vbom = activity.getVertexBufferObjectManager();
    	this.engine = activity.getEngine();
    	this.camera = engine.getCamera();
    }
    
    public void initialize(GameActivity activity, ResourceManager res) {
    	this.res = res;
    	this.activity = activity;
    	this.vbom = activity.getVertexBufferObjectManager();
    	this.engine = activity.getEngine();
    	this.camera = engine.getCamera();
    }
    
	public abstract void loadResources();
	public abstract void create();
	public abstract void unloadResources();
	public abstract void destroy();
	public void onBackKeyPressed() {
		Debug.d("Back key pressed");
	}
    public abstract void onPause();
    public abstract void onResume();
}
